Skip to content

Check Node.js at session start in the plugin - #18

Merged
svincent240 merged 2 commits into
mainfrom
feat/plugin-node-preflight
Oct 30, 2026
Merged

svincent240 merged 2 commits into
mainfrom
feat/plugin-node-preflight

Conversation

@svincent240

Copy link
Copy Markdown
Contributor

Description

The plugin's MCP server needs Node.js to start. When Node.js was missing, the CourseCode tools just failed to appear, and the launcher's helpful error never ran because it needs Node.js too.

This adds a Claude Code SessionStart hook that needs no Node.js. When Node.js is missing or older than 22.15, it tells the AI tool to use the setup skill, which asks before installing anything. When Node.js is fine, it prints nothing.

The same file, plugin/hooks/check-node.cmd, works as a shell script and a Windows batch file. A new CI job runs it on a Windows runner.

Merge #17 first. This branch is built on it, so its commit shows here until then.

Related Issue

None.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Other (describe): CI job for Windows

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's code style
  • I have run npm run lint and it passes
  • I have tested my changes with npm run preview
  • I have updated documentation if needed
  • My commits follow the conventional commit format

Preview doesn't apply because this only changes the plugin. The commit follows the repository's recent commit style.

Testing

  • Plugin and create tests: 43 passed
  • npm run lint and claude plugin validate plugin passed
  • macOS: the hook ran with Node.js hidden from PATH and with a too-old version
  • Windows: scripts/smoke-plugin-session-check.ps1 runs in CI with supported, old, and missing Node.js, in Git Bash, Windows PowerShell, and PowerShell 7

Not tested: a real AI tool acting on the message. The Windows check runs the hook's command directly, not through Claude Code.

Screenshots (if applicable)

Not applicable.

🤖 Generated with Claude Code

svincent240 and others added 2 commits October 30, 2026 11:37
The commands create printed failed after npx coursecode create when
coursecode wasn't installed globally, so they now use npx. New projects
also point people to their AI tool, start at version 1.0.0, and no longer
carry the template author's name.

The README leads with the plugin. New projects use ESLint 10, create no
longer prints npm's audit and funding notices, the narration help lists
all five providers, and the npm homepage points to the site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plugin's MCP server needs Node.js to start, so when it was missing
the CourseCode tools just failed to appear and the launcher's error never
ran. A SessionStart hook now tells the AI tool to use the setup skill when
Node.js is missing or too old. The hook needs no Node.js and stays silent
when the version is fine.

The hook runs in sh, Git Bash, and PowerShell, so CI now tests it on a
Windows runner in Git Bash and both versions of PowerShell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@svincent240
svincent240 merged commit 73e938b into main Oct 30, 2026
3 checks passed
@svincent240 svincent240 mentioned this pull request Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant